<?php
namespace Admin\Controller;
/**
 * 品牌列表
 * User: linkwhy
 * Date: 2015/10/22
 * Time: 14:54
 */
class BrandController extends AdminController{

    public function index(){
        $list   = $this->lists('brand');
        int_to_string($list);
        $this->assign('_list', $list);
        $this->meta_title = '商品品牌';
        $this->display();
    }

    public function add(){
        $this->meta_title = '新增品牌';
        $this->display('update');
    }

    public function edit(){
        $brand = M('brand');
        $data = $brand->field('id,name')->where(array('id' => I('get.id')))->find();
        $this->meta_title = '修改品牌';
        $this->assign('data', $data);
        $this->display('update');
    }

}